x86/HVM: avoid pointer wraparound in bufioreq handling
authorJan Beulich <jbeulich@suse.com>
Thu, 18 Jun 2015 14:44:15 +0000 (16:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Jun 2015 14:44:15 +0000 (16:44 +0200)
commitb7007bc6f9a45cef9262b1ec4280eb67140a5112
treee80891f27295949ebce3a32f9554c4c78d96acc5
parentcc0fa33fe8b6c2c8ed9d078705070b62ec396051
x86/HVM: avoid pointer wraparound in bufioreq handling

The number of slots per page being 511 (i.e. not a power of two) means
that the (32-bit) read and write indexes going beyond 2^32 will likely
disturb operation. Extend I/O req server creation so the caller can
indicate that it is using suitable atomic accesses where needed (not
all accesses to the two pointers really need to be atomic), allowing
the hypervisor to atomically canonicalize both pointers when both have
gone through at least one cycle.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/libxc/include/xenctrl.h
tools/libxc/xc_domain.c
xen/arch/x86/hvm/hvm.c
xen/include/asm-x86/hvm/domain.h
xen/include/public/hvm/hvm_op.h
xen/include/public/hvm/ioreq.h